package tiled.mapeditor.util;

import java.awt.image.RGBImageFilter;

public class TransparentImageFilter extends RGBImageFilter
{
    int trans;

    public TransparentImageFilter(int col)
    {
        trans = col;

        canFilterIndexColorModel = true;
    }

    public int filterRGB(int x, int y, int rgb)
    {
        if (rgb == trans)
        {
            return 0;
        }
        else
        {
            return rgb;
        }
    }
}
